package project.base

//import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig
import org.mybatis.spring.annotation.MapperScan
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.web.servlet.ServletComponentScan
import org.springframework.scheduling.annotation.EnableAsync
import org.springframework.transaction.annotation.EnableTransactionManagement

//@EnableApolloConfig
@SpringBootApplication
@MapperScan(basePackages = ["project.base.dao"])
@EnableAsync
@EnableConfigurationProperties
@ServletComponentScan
@EnableTransactionManagement    // 开启事务
open class BaseServerApplication {

    companion object {
        @JvmStatic
        fun main(args: Array<String>) {
            val context = SpringApplication.run(BaseServerApplication::class.java, *args)
            val env = context.environment
            println("""        
+-------------------------------------------------+  
 project:  '${env.getProperty("spring.application.name")}' start success :)                    
 swagger:  http://127.0.0.1:${env.getProperty("server.port", "8003")}/doc.html  
 druid:    http://127.0.0.1:${env.getProperty("server.port", "8003")}/druid     
+-------------------------------------------------+        
            """)
        }
    }
}
